home *** CD-ROM | disk | FTP | other *** search
/ Champak 83 / (Vol 83) My Disc.iso / Games / drying.swf / scripts / frame_132 / PlaceObject2_183_701 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2008-08-08  |  923b  |  44 lines

  1. onClipEvent(enterFrame){
  2.    if(this.state == "stop")
  3.    {
  4.       if(this.delay_tmp <= 0)
  5.       {
  6.          this.state = "run";
  7.          delay_tmp = this.delay;
  8.          sndRain.start(0,1);
  9.       }
  10.       else
  11.       {
  12.          delay_tmp--;
  13.       }
  14.    }
  15.    else if(this.state == "run")
  16.    {
  17.       this._x -= 2;
  18.       if(this.hitTest(_root.mcPlayer.mcBody))
  19.       {
  20.          this.mcRain._y = -50;
  21.       }
  22.       else
  23.       {
  24.          i = 1;
  25.          while(i <= 4)
  26.          {
  27.             if(this.hitTest(_root["mcCloth" + i].mcBody))
  28.             {
  29.                _root["mcCloth" + i].wait += 4;
  30.                _root["mcCloth" + i].isWet = true;
  31.                _root["mcCloth" + i].mcCloth.gotoAndPlay(1);
  32.             }
  33.             i++;
  34.          }
  35.          this.mcRain._y = 125;
  36.       }
  37.       if(this._x < -100)
  38.       {
  39.          this._x = 500;
  40.          this.state = "stop";
  41.       }
  42.    }
  43. }
  44.